package com.wangzaiplus.test.service;

import com.wangzaiplus.test.dto.ProductLockDto;

;

/**
 * Created by Administrator on 2018/10/17.
 */

public interface DataLockService {








    public int updateStock(ProductLockDto dto) throws Exception ;





    /**
     * 更新商品库存-乐观锁
     * @param dto
     * @return
     * @throws Exception
     */

    public int updateStockPositive(ProductLockDto dto) throws Exception ;


    /**
     * 更新商品库存-悲观锁
     * @param dto
     * @return
     * @throws Exception
     */
    public int updateStockNegative(ProductLockDto dto) throws Exception;
    /**
     * 基于redis实战分布式锁
     * @param dto
     * @return
     * @throws Exception
     */
    public int updateStockRedis(ProductLockDto dto) throws Exception ;;






    /**
     * 基于zookeepr实战分布式锁
     * @param dto
     * @return
     * @throws Exception
     */
    public int updateStockZookeeper(ProductLockDto dto) throws Exception ;



    /**
     * 基于redisson实战分布式锁
     * @param dto
     * @return
     * @throws Exception
     */
    public int updateStockRedisson(ProductLockDto dto) throws Exception ;
}















































